package prototype.fromKanYun.shallow;

public class Prototype implements Cloneable{
    private int age;
    private int[] array;

    public Prototype() {
    }

    public Prototype(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int[] getArray() {
        return array;
    }

    public void setArray(int[] array) {
        this.array = array;
    }

    /**
     * 因为Cloneable接口是个空接口
     * 此处的重点是super.clone()这句话，super.clone()调用的是Object的clone()方法，而在Object类中，
     * clont()是native的。
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return (Prototype)super.clone();
    }

}
